package com.yami.shop.controller;

import com.yami.shop.common.response.ServerResponseEntity;
import com.yami.shop.service.impl.RongYunGagServiceImpl;
import com.yami.shop.vo.group.gag.GroupGagVo;
import com.yami.shop.vo.group.gag.GroupGayRemVo;
import io.rong.models.response.ListGagGroupUserResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;


/**
 * 群成员禁言  单个或多个用户
 */
@RestController("rongYunGagController")
@RequestMapping("/account/im/group/gag")
@Schema(description= "app-钱包IM成员禁言")
public class RongYunGagController {

    @Autowired
    private RongYunGagServiceImpl gagService;

    @PostMapping("/group_gag_add")
    @Operation(summary =  "禁言单个或多个用户")
    public ServerResponseEntity<String> create(@RequestBody @Valid GroupGagVo groupVo) throws Exception {
        return gagService.add(groupVo);
    }

    @PostMapping("/group_gag_remove")
    @Operation(summary =  "移除禁言单个或多个用户")
    public ServerResponseEntity<String> remove(@RequestBody @Valid GroupGayRemVo groupVo) throws Exception {
        return gagService.remove(groupVo);
    }

    @GetMapping("/group_gag_list")
    @Operation(summary =  "查询被禁言群成员", description = "查询被禁言群成员")
    public ServerResponseEntity getUserInfo(@RequestParam String groupId) throws Exception {
        return gagService.getList(groupId);
    }

}
